Return to doc.sitecore.com

Valid for Sitecore 5.3
  HTML Tags collapsing

Note: This issue is only valid for Sitecore CMS V.5.3.1

The Problem

When rendering xslts in xml-output-mode (to be able to produce valid xhtml) some tags are collapsed if they don't have any content. This causes rendering errors in the browser, as the browsers can't handle some tags being collapsed (div:s for example)

The Solution

To fix this problem please download and install the following patch.

The patch consists of the following customizations:

To apply this customization the following lines should be changed in Web.config:

  1. configuration/sitecore/renderingControls:

    <control template="xsl rendering" type="Sitecore.Web.UI.XslControlRenderingType, Sitecore.Kernel" propertyMap="Path=path" />
    should be replaced with:
    <control template="xsl rendering" type="Sitecore.Web.UI.XHtmlXslControlRenderingType, Sitecore.XslOutputPatch" propertyMap="Path=path" />

  2. configuration/system.web/pages node:

    tag mapping should be added to the pages element, so that it should looks like the following:
    <pages validateRequest="false" >
      <tagMapping>
        <add tagType="Sitecore.Web.UI.WebControls.XslFile" mappedTagType="Sitecore.Web.UI.WebControls.XHtmlXslFile,Sitecore.XslOutputPatch"/>
      </tagMapping>
    </pages>

Note: If your pages element is not empty you should add mapping for XslFile only and leave other pages' elements unchanged.